package com.wedo.mall.entity;

import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;

/**
 * Created by Lawrence on 2017/7/14.
 */

public class MyAddress implements Parcelable {
    /**
     * id : 1
     * user_id : 35
     * consignee : 木木个小菠萝
     * province : 2
     * city : 52
     * county : 500
     * address : ??????????
     * telephone : 13632486666
     * add_time : 1489126457
     * is_default : 0
     * province_name : 北京
     * city_name : 北京
     * county_name : 东城区
     */

    public String id;
    public String user_id;
    public String consignee;
    public String province;
    public String city;
    public String county;
    public String address;
    public String telephone;
    public String add_time;
    public String is_default;
    public String province_name;
    public String city_name;
    public String county_name;
/*    public String name;
    public String number;
    public String address;
    public boolean isDefault;*/

    public boolean isDefault(){
        return TextUtils.equals("1",is_default);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUser_id() {
        return user_id;
    }

    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }

    public String getConsignee() {
        return consignee;
    }

    public void setConsignee(String consignee) {
        this.consignee = consignee;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCounty() {
        return county;
    }

    public void setCounty(String county) {
        this.county = county;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getAdd_time() {
        return add_time;
    }

    public void setAdd_time(String add_time) {
        this.add_time = add_time;
    }

    public String getIs_default() {
        return is_default;
    }

    public void setIs_default(String is_default) {
        this.is_default = is_default;
    }

    public String getProvince_name() {
        return province_name;
    }

    public void setProvince_name(String province_name) {
        this.province_name = province_name;
    }

    public String getCity_name() {
        return city_name;
    }

    public void setCity_name(String city_name) {
        this.city_name = city_name;
    }

    public String getCounty_name() {
        return county_name;
    }

    public void setCounty_name(String county_name) {
        this.county_name = county_name;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.user_id);
        dest.writeString(this.consignee);
        dest.writeString(this.province);
        dest.writeString(this.city);
        dest.writeString(this.county);
        dest.writeString(this.address);
        dest.writeString(this.telephone);
        dest.writeString(this.add_time);
        dest.writeString(this.is_default);
        dest.writeString(this.province_name);
        dest.writeString(this.city_name);
        dest.writeString(this.county_name);
    }

    public MyAddress() {
    }

    protected MyAddress(Parcel in) {
        this.id = in.readString();
        this.user_id = in.readString();
        this.consignee = in.readString();
        this.province = in.readString();
        this.city = in.readString();
        this.county = in.readString();
        this.address = in.readString();
        this.telephone = in.readString();
        this.add_time = in.readString();
        this.is_default = in.readString();
        this.province_name = in.readString();
        this.city_name = in.readString();
        this.county_name = in.readString();
    }

    public static final Parcelable.Creator<MyAddress> CREATOR = new Parcelable.Creator<MyAddress>() {
        @Override
        public MyAddress createFromParcel(Parcel source) {
            return new MyAddress(source);
        }

        @Override
        public MyAddress[] newArray(int size) {
            return new MyAddress[size];
        }
    };
}
